<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>

  <div id="app">
    <compa :user="username"></compa>
  </div>


  <script>

    // Vue.component


    const compb = {
      props: ['myuser'],
      template: '<h2>gp18-compb-{{myuser}}</h2>'
    }

    const compc = {
      props: ['myuser'],
      template: '<h2>gp18-compb-{{myuser}}</h2>'
    }


    const compa = {
      props: ['user'],
      data() {
        return {
          name: 'xiaoming'
        }
      },
      template: `
      <div>
        <h1>
          gp18-compa
        </h1>
        <compb :myuser="user"></compb>
        <compc :myuser="user"></compc>
      </div>
      `,
      components: {
        compb
      }
    }


    var vm = new Vue({
      el: "#app",
      data: {
        username: 'hanye'
      },
      components: {
        compa
      }
    })

  </script>

</body>

</html>